ig.module(
    
    'game.entities.roundbullit'
    
).requires(
    
    'impact.entity'
    
).defines(function(){

    EntityRoundBullit = ig.Entity.extend({
        size:{
            x: 6,
            y: 6
        },
        offset:{
            x: 0,
            y: 0
        },
        maxVel: {
            x: 250,
            y: 250
        },
        player: null,        
        type: ig.Entity.TYPE.A,        
        checkAgainst: ig.Entity.TYPE.B,        
        health: 1,        
        animSheet: new ig.AnimationSheet('media/sprites/bullit.png',6,6),
        
        radius: 15,
        step: {
            x: 0.8,
            y: 0.8
        },
        angle: 15,
        pivot: {
            x: 60,
            y: 60
        },
        pivotRelCord: {
            x: 0,
            y: 0
        },
        init: function( x, y, settings){
            this.parent(x, y, settings);
            this.addAnim('idle', 1, [0]);           
            
            this.pivot = ig.Utils.scaleToLen( this.step, this.radius );
            this.pivotRelCord = {x: 10, y: 10};//ig.Utils.oposite( this.pivot );
        },
        update: function(){
            this.pivot.x += this.step.x;
            this.pivot.y += this.step.y;
            this.pivotRelCord = ig.Utils.turn( this.pivotRelCord, this.angle )
            this.pos = ig.Utils.add( this.pivot, this.pivotRelCord );            
            this.parent();
        },
        check: function( other ){
            this.kill();
            other.receiveDamage( 10 );
        }
    });
});